{%assign var='search_fields' value=$CONFIG->search%}

<form action="{%$categories[9]->href%}" method="GET">
   <input type="text" name="query" value="{%$data.query.query|default:''%}" /><br />
   {%if $search_fields.category%}
   <select name="c">
      <option value=""> --- </option>
      {%foreach from=$search_fields.category item='v'%}
      {%if $v eq 'all'%}
      <option value="0">{%$TR->meccano->allcategories%}</option>
      {%else%}
      <option value="{%$v%}">{%$categories[$v]->title%}</option>
      {%/if%}
   {%/foreach%}
   {%/if%}
   </select><br />
   <input type="submit" name="commit" value=" {%$categories[9]->title%} ">
</form>

{%if $data.results%}
   <h3>{%$TR->site->youdidsearch%}: <b>{%$data.query.query%}</b></h3>
   <h4>{%$TR->site->found%}: {%$data.found%} {%$TR->site->results%}</h4>
   <br /><br />

   {%foreach from=$data.results item='r' name='i'%}
   <h4><a href="{%$r.href%}">{%$r.title%}</a></h4>
   <span>{%$r.description%}</span>
   <br>

   {%if $smarty.foreach.i.last && $pages%}
      {%if $pages.prev%}<a href="{%$pages.prev.href%}">{%$TR->prev%}</a> | {%/if%}

      {%foreach from=$pages.links item='p'%}
         {%if $p.current%}
            {%$p.num%}
         {%else%}
            <a href="{%$p.href%}">{%$p.num%}</a>
         {%/if%}
      {%/foreach%}

      {%if $pages.next%} | <a href="{%$pages.next.href%}">{%$TR->next%}</a>{%/if%}
   {%/if%}
   {%foreachelse%}
      {%$category.description%}
   {%/foreach%}
{%/if%}